<?php

class biblia {
	
	//var $this->conexao;
	//var $this->testamento;
	
	function biblia(){}
	
		
	function Show(){
		
		$saida .= "<table align='center' id='tabela_indice'>";
		$saida .= "	<tr>";
		$saida .= "		<td valign='top'>";
		$saida .= "		<div id='indice'>";
		$saida .= "			<b>Velho Testamento</b>";
		$saida .= indice($this->conexao,"1");
		$saida .= "		</div>";
		$saida .= "		</td>";
		$saida .= "		<td valign='top'>";
		$saida .= "		<div id='indice'>";
		$saida .= "			<b>Novo Testamento</b>";
		$saida .= indice($this->conexao,"2");
		$saida .= "		</div>";
		$saida .= "		</td>";
		$saida .= "	</tr>";
		$saida .= "</table>";
		
		echo $saida;
		}
		
	function indice($conexao,$testamento){
		$comando		=		"SELECT * FROM Livros WHERE codTestamento = '".$this->testamento."'";
		$query				=		mysql_query($comando, $this->conexao);
		
		$saida .= "<ul>";
		while($rs					=		mysql_fetch_array($query)){
			$saida .= "<li><a href='../home/?ct=lv&tt=".$this->testamento."&cl=".$rs['codLivro']."'>".$rs['titulo']."</a></li>";
			}
		$saida .= "</ul>";
		echo $saida;
		}

}

?>